<?php
/**
 * @Author:  zhanghong
 * @Date:    2017-03-10 14:56:00
 * @version  $Id$
 */
class DatayizhuliuchengModel extends BaseModel
{
    public $_field_arr = ['id','zhixing_state','zhixing_code',
        'show_name_tab', 'show_name_button', 'show_name_column',
        'is_need', 'is_flow', 'create_time', 'op_type','yiyuan_id'];

    //获取医嘱流程给终端，包含显示和流程
    public function ls(){
        return DB::select('*')
            ->from('data_yizhu_zhixing_liucheng')
            ->where('yiyuan_id','=',$this->yiyuan_id)
            ->order_by('paixu', 'ASC')
            ->execute()
            ->as_array();
    }
    //获取医嘱流程  api使用
    public function getDataLiucheng()
    {
        return DB::select('*')
            ->from('data_yizhu_zhixing_liucheng')
            ->where('yiyuan_id','=',$this->yiyuan_id)
            ->and_where('is_need','=',1)
            ->and_where('is_flow','=',1)
            ->order_by('id', 'ASC')
            ->execute()
            ->as_array();
    }
}
